﻿using System.Data.Entity;
using TavDom.Library.Entities.Concrete;
using TavDom.Library.Entities.Mappings.EntityFramework;

namespace TavDom.Library.DataAccess.Concrete.EntityFramework.ContextBase
{
    public class DatabaseContext : DbContext
    {
        public DatabaseContext()
        {
            Database.SetInitializer<DatabaseContext>(null);
            Configuration.LazyLoadingEnabled = true;
        }

        public DbSet<User> Users { get; set; }

        public DbSet<ContentType> ContentTypes { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new UserMap());
            modelBuilder.Configurations.Add(new ContentTypeMap());
        }

    }
}
